Optimal. Leaf size=145 \[ \frac {a \left (2 a^2 B+9 a b C+8 b^2 B\right ) \tan (c+d x)}{3 d}+\frac {a^2 (3 a C+5 b B) \tan (c+d x) \sec (c+d x)}{6 d}+\frac {\left (a^3 C+3 a^2 b B+6 a b^2 C+2 b^3 B\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {a B \tan (c+d x) \sec ^2(c+d x) (a+b \cos (c+d x))^2}{3 d}+b^3 C x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.43, antiderivative size = 145, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {3029, 2989, 3031, 3021, 2735, 3770} \[ \frac {a \left (2 a^2 B+9 a b C+8 b^2 B\right ) \tan (c+d x)}{3 d}+\frac {\left (3 a^2 b B+a^3 C+6 a b^2 C+2 b^3 B\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {a^2 (3 a C+5 b B) \tan (c+d x) \sec (c+d x)}{6 d}+\frac {a B \tan (c+d x) \sec ^2(c+d x) (a+b \cos (c+d x))^2}{3 d}+b^3 C x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2735
Rule 2989
Rule 3021
Rule 3029
Rule 3031
Rule 3770
Rubi steps
\begin {align*} \int (a+b \cos (c+d x))^3 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^5(c+d x) \, dx &=\int (a+b \cos (c+d x))^3 (B+C \cos (c+d x)) \sec ^4(c+d x) \, dx\\ &=\frac {a B (a+b \cos (c+d x))^2 \sec ^2(c+d x) \tan (c+d x)}{3 d}+\frac {1}{3} \int (a+b \cos (c+d x)) \left (a (5 b B+3 a C)+\left (2 a^2 B+3 b^2 B+6 a b C\right ) \cos (c+d x)+3 b^2 C \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx\\ &=\frac {a^2 (5 b B+3 a C) \sec (c+d x) \tan (c+d x)}{6 d}+\frac {a B (a+b \cos (c+d x))^2 \sec ^2(c+d x) \tan (c+d x)}{3 d}-\frac {1}{6} \int \left (-2 a \left (2 a^2 B+8 b^2 B+9 a b C\right )-3 \left (3 a^2 b B+2 b^3 B+a^3 C+6 a b^2 C\right ) \cos (c+d x)-6 b^3 C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx\\ &=\frac {a \left (2 a^2 B+8 b^2 B+9 a b C\right ) \tan (c+d x)}{3 d}+\frac {a^2 (5 b B+3 a C) \sec (c+d x) \tan (c+d x)}{6 d}+\frac {a B (a+b \cos (c+d x))^2 \sec ^2(c+d x) \tan (c+d x)}{3 d}-\frac {1}{6} \int \left (-3 \left (3 a^2 b B+2 b^3 B+a^3 C+6 a b^2 C\right )-6 b^3 C \cos (c+d x)\right ) \sec (c+d x) \, dx\\ &=b^3 C x+\frac {a \left (2 a^2 B+8 b^2 B+9 a b C\right ) \tan (c+d x)}{3 d}+\frac {a^2 (5 b B+3 a C) \sec (c+d x) \tan (c+d x)}{6 d}+\frac {a B (a+b \cos (c+d x))^2 \sec ^2(c+d x) \tan (c+d x)}{3 d}-\frac {1}{2} \left (-3 a^2 b B-2 b^3 B-a^3 C-6 a b^2 C\right ) \int \sec (c+d x) \, dx\\ &=b^3 C x+\frac {\left (3 a^2 b B+2 b^3 B+a^3 C+6 a b^2 C\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {a \left (2 a^2 B+8 b^2 B+9 a b C\right ) \tan (c+d x)}{3 d}+\frac {a^2 (5 b B+3 a C) \sec (c+d x) \tan (c+d x)}{6 d}+\frac {a B (a+b \cos (c+d x))^2 \sec ^2(c+d x) \tan (c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.59, size = 108, normalized size = 0.74 \[ \frac {2 a^3 B \tan ^3(c+d x)+3 a \tan (c+d x) \left (2 a^2 B+a (a C+3 b B) \sec (c+d x)+6 a b C+6 b^2 B\right )+3 \left (a^3 C+3 a^2 b B+6 a b^2 C+2 b^3 B\right ) \tanh ^{-1}(\sin (c+d x))+6 b^3 C d x}{6 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.49, size = 189, normalized size = 1.30 \[ \frac {12 \, C b^{3} d x \cos \left (d x + c\right )^{3} + 3 \, {\left (C a^{3} + 3 \, B a^{2} b + 6 \, C a b^{2} + 2 \, B b^{3}\right )} \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (C a^{3} + 3 \, B a^{2} b + 6 \, C a b^{2} + 2 \, B b^{3}\right )} \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, B a^{3} + 2 \, {\left (2 \, B a^{3} + 9 \, C a^{2} b + 9 \, B a b^{2}\right )} \cos \left (d x + c\right )^{2} + 3 \, {\left (C a^{3} + 3 \, B a^{2} b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{12 \, d \cos \left (d x + c\right )^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.36, size = 336, normalized size = 2.32 \[ \frac {6 \, {\left (d x + c\right )} C b^{3} + 3 \, {\left (C a^{3} + 3 \, B a^{2} b + 6 \, C a b^{2} + 2 \, B b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (C a^{3} + 3 \, B a^{2} b + 6 \, C a b^{2} + 2 \, B b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (6 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 9 \, B a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 18 \, C a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 18 \, B a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 4 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 36 \, C a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 36 \, B a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 9 \, B a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 18 \, C a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 18 \, B a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3}}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.36, size = 223, normalized size = 1.54 \[ \frac {C \,a^{3} \sec \left (d x +c \right ) \tan \left (d x +c \right )}{2 d}+\frac {C \,a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d}+\frac {2 a^{3} B \tan \left (d x +c \right )}{3 d}+\frac {a^{3} B \tan \left (d x +c \right ) \left (\sec ^{2}\left (d x +c \right )\right )}{3 d}+\frac {3 C \,a^{2} b \tan \left (d x +c \right )}{d}+\frac {3 a^{2} b B \sec \left (d x +c \right ) \tan \left (d x +c \right )}{2 d}+\frac {3 a^{2} b B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d}+\frac {3 C a \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {3 B a \,b^{2} \tan \left (d x +c \right )}{d}+b^{3} C x +\frac {b^{3} C c}{d}+\frac {b^{3} B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.33, size = 216, normalized size = 1.49 \[ \frac {4 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B a^{3} + 12 \, {\left (d x + c\right )} C b^{3} - 3 \, C a^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 9 \, B a^{2} b {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 18 \, C a b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, B b^{3} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 36 \, C a^{2} b \tan \left (d x + c\right ) + 36 \, B a b^{2} \tan \left (d x + c\right )}{12 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.30, size = 526, normalized size = 3.63 \[ \frac {\frac {B\,a^3\,\sin \left (3\,c+3\,d\,x\right )}{6}+\frac {C\,a^3\,\sin \left (2\,c+2\,d\,x\right )}{4}+\frac {B\,a^3\,\sin \left (c+d\,x\right )}{2}+\frac {3\,B\,a\,b^2\,\sin \left (c+d\,x\right )}{4}+\frac {3\,C\,a^2\,b\,\sin \left (c+d\,x\right )}{4}-\frac {B\,b^3\,\cos \left (c+d\,x\right )\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,3{}\mathrm {i}}{2}-\frac {C\,a^3\,\cos \left (c+d\,x\right )\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,3{}\mathrm {i}}{4}+\frac {3\,C\,b^3\,\cos \left (c+d\,x\right )\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2}+\frac {3\,B\,a^2\,b\,\sin \left (2\,c+2\,d\,x\right )}{4}+\frac {3\,B\,a\,b^2\,\sin \left (3\,c+3\,d\,x\right )}{4}+\frac {3\,C\,a^2\,b\,\sin \left (3\,c+3\,d\,x\right )}{4}-\frac {B\,b^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )\,1{}\mathrm {i}}{2}-\frac {C\,a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )\,1{}\mathrm {i}}{4}+\frac {C\,b^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{2}-\frac {B\,a^2\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )\,3{}\mathrm {i}}{4}-\frac {C\,a\,b^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )\,3{}\mathrm {i}}{2}-\frac {B\,a^2\,b\,\cos \left (c+d\,x\right )\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,9{}\mathrm {i}}{4}-\frac {C\,a\,b^2\,\cos \left (c+d\,x\right )\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,9{}\mathrm {i}}{2}}{d\,\left (\frac {3\,\cos \left (c+d\,x\right )}{4}+\frac {\cos \left (3\,c+3\,d\,x\right )}{4}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________